import request from '@/router/axios';

export const getList = (currentPage,pageSize, params) => {
  return request({
    url: '/api/doctor/openDoctorTable',
    method: 'post',
    params: {
      doctorName: params.name,
      currentPage,
      pageSize,
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/doctor/deleteDoctorByIds',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/doctor/addDoctor',
    method: 'post',
    params:{
      id: row.id,
      name: row.name,
      sex: row.sex,
      phone: row.phone,
      email: row.email,
      birthday: row.birthday,
      doctorCategoryid: row.doctorCategoryid,
    },
  })
}

export const update = (row) => {
  return request({
    url: '/api/doctor/updateDoctor',
    method: 'post',
    params:{
      id: row.id,
      name: row.name,
      sex: row.sex,
      phone: row.phone,
      email: row.email,
      birthday: row.birthday,
      doctorCategoryid: row.doctorCategoryid,
    },
  })
}

export const getNotice = (id) => {
  return request({
    url: '/api/doctor/selectAllDoctor',
    method: 'post',
    params: {
      id
    }
  })
}

